<template>
  <div>
    <button @click="sendServe">点击向服务器发送请求</button>
    <input type="file" name="" id="file" style="display:block">
    <input type="submit" @click="handleFormData">向服务器上传formdata数据</input>
  </div>
</template>

<script>
import axios from "axios";

// axios.defaults.baseURL = "http://10.23.15.184:8083";
export default {
  name: "Index",
  data() {
    return {
      files:[],
    };
  },
  mounted() {
  },
  methods: {
    sendServe() {
      this.$axios.get("/api/my").then((res) => {
        console.log(res.data);
      });
    },
    handleFormData(){
      var file=document.querySelector('#file').files[0]
      console.log(file)
    },
  },
};
</script>

<style lang="scss" scoped>
</style>